inotify: ‘too many open files’
inotify is a part of the Linux kernel which can be used to monitors changes to the filesystem. Among other softwares, this interface is used by the file watcher of Deno, a JavaScript runtime used by Quarto. Rendering a large project often leads to the message
Error: Too many open files (os error 24)This is caused by Deno reaching the limit of /proc/sys/fs/inotify/max_user_instances, which by default is 128.
The limit can be temporarily raised by
echo "1024" | sudo tee /proc/sys/fs/inotify/max_user_instancesand permanently by an entry
fs.inotify.max_user_instances=1024in /etc/sysctl.conf, the configuration file for the kernel parameter configuration tool sysctl. For the change to take effect immediately,
sudo sysctl -pis necessary.
sysctl is not related to systemd, but it is controlled by a systemd service systemd-sysctl.service, and therefore
sudo systemctl restart systemd-sysctl.servicecan be used instead.